<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template private_node_allocator</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__node__allocator_8hpp" title="Header &lt;boost/interprocess/allocators/private_node_allocator.hpp&gt;">
<link rel="prev" href="private__adaptive__pool_8hpp_1a74111b10a62b43195fd1de4fd96bfadd.html" title="Function template operator!=">
<link rel="next" href="structboost_1_1interprocess_1_1private__node__allocator_1_1rebind.html" title="Struct template rebind">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="private__adaptive__pool_8hpp_1a74111b10a62b43195fd1de4fd96bfadd.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__node__allocator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1interprocess_1_1private__node__allocator_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template private_node_allocator</span></h2>
<p>boost::interprocess::private_node_allocator</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__node__allocator_8hpp" title="Header &lt;boost/interprocess/allocators/private_node_allocator.hpp&gt;">boost/interprocess/allocators/private_node_allocator.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> SegmentManager<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> NodesPerBlock<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">segment_manager</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a8d1f32a9039cdf015b3a2961f1af8a29"></a><span class="identifier">segment_manager</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">void_pointer</span>           <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a6c5ee8e09114a0b2a4be253dfd1487b6"></a><span class="identifier">void_pointer</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">pointer</span>         <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ae28d133b6a0a425ba6897ebfa59ae5ee"></a><span class="identifier">pointer</span><span class="special">;</span>        
  <span class="keyword">typedef</span> <span class="identifier">implementation_defined</span><span class="special">::</span><span class="identifier">const_pointer</span>   <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a8211d8cb93f84a8703c7c4f827fe0c04"></a><span class="identifier">const_pointer</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                       <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1af8be210af6e3ec19cf48f5bfc32cb5ab"></a><span class="identifier">value_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ad49dfc3221b458f1d881cd888e106fd4"></a><span class="identifier">reference</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>                             <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ad6f4b7386a12de83aeb12bf32dd14bd3"></a><span class="identifier">const_reference</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">segment_manager</span><span class="special">::</span><span class="identifier">size_type</span>              <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a95bd7aa938865d220305a03bcfd963b9"></a><span class="identifier">size_type</span><span class="special">;</span>      
  <span class="keyword">typedef</span> <span class="identifier">segment_manage</span><span class="special">::</span><span class="identifier">difference_type</span>         <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a1a71e97f9c7eddc7f5e6dac947bd1423"></a><span class="identifier">difference_type</span><span class="special">;</span>

  <span class="comment">// member classes/structs/unions</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <span class="keyword">struct</span> <a class="link" href="structboost_1_1interprocess_1_1private__node__allocator_1_1rebind.html" title="Struct template rebind">rebind</a> <span class="special">{</span>
    <span class="comment">// types</span>
    <span class="keyword">typedef</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <a class="link" href="structboost_1_1interprocess_1_1private__node__allocator_1_1rebind.html#doxygen.boost_interprocess_header_reference.structboost_1_1interprocess_1_1private__node__allocator_1_1rebind_1a134b425427751f2f6a1282475adc3ae6"><span class="identifier">other</span></a><span class="special">;</span>
  <span class="special">}</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/classboost_1_1container_1_1devector.html#id18-bb">private member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a5c6da91d00da9e62c5afe649baa15fff"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a14fa523b81300aa4c3404e72b28bbd45"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/classboost_1_1container_1_1devector.html#id19-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a9f7d0023a9166cd756009a2ad9b363ff"><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a7b5e79a910935910e810c36323bb483d"><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a05ff6fabe2e80dfc2bc229c00ba7d238"><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a909a7db34a2a73072187f80e460613ce"><span class="special">~</span><span class="identifier">private_node_allocator</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">node_pool_t</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a923c2c1779b1ec0998bfecce6dad8d40"><span class="identifier">get_node_pool</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">segment_manager</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a3e9b4035058a6e60661f8cfcd0e4b892"><span class="identifier">get_segment_manager</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a0bc39a3729b7120c51331e3fd6e26485"><span class="identifier">max_size</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a1c21c614c3522dc0c9b17474a3a238d4"><span class="identifier">allocate</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">cvoid_pointer</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a2d8f5cf1e99e358428ba89f15a87b3fa"><span class="identifier">deallocate</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1aad62c959525fa1c8d523711342211d2a"><span class="identifier">deallocate_free_blocks</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ad1ae73cfdc1eb6a9442c703fe7f9eea8"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">const_pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a9565fcbc2b56d44aa1d64f935fd4af04"><span class="identifier">address</span></a><span class="special">(</span><span class="identifier">const_reference</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a3069e9cc315813531e4163a564b1181c"><span class="identifier">construct</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">const_reference</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a380dd74ad20a84e4694c69ca7dedbead"><span class="identifier">destroy</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">size_type</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a50c969eba82fc4b35ecbee43d3809e63"><span class="identifier">size</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1adc2307da55baac1e02fcb975d8af147b"><span class="identifier">allocation_command</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> 
                             <span class="identifier">size_type</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a83bb002d201537ba2792cab8785f36e6"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a89fbbfee49116bb42845465e86f06987"><span class="identifier">allocate_many</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a66d21182bf1f50c75b300d2809a6ba90"><span class="identifier">deallocate_many</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">pointer</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ac15da8a1118ed1859b51101d0a6e05d7"><span class="identifier">allocate_one</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a843dfee9a7c61750596cf5086113ddde"><span class="identifier">allocate_individual</span></a><span class="special">(</span><span class="identifier">size_type</span><span class="special">,</span> <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a6ec722b4bc59327bed01cfc0261ff3ca"><span class="identifier">deallocate_one</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a594ea1f4c7a868a0c054d76bbbd7b0ad"><span class="identifier">deallocate_individual</span></a><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#id20-bb">friend functions</a></span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a63777ee47c37b3f6817aa6fc57db0e0d"><span class="identifier">swap</span></a><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.16.19.3.8.4.4"></a><h2>Description</h2>
<p>An STL node allocator that uses a segment manager as memory source. The internal pointer type will of the same type (raw, smart) as "typename SegmentManager::void_pointer" type. This allows placing the allocator in shared memory, memory mapped-files, etc... This allocator has its own node pool. NodesPerBlock is the number of nodes allocated at once when the allocator needs runs out of nodes </p>
<div class="refsect2">
<a name="id-1.3.16.19.3.8.4.4.3"></a><h3>
<a name="id18-bb"></a><code class="computeroutput">private_node_allocator</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">,</span> <span class="keyword">typename</span> SegmentManager2<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> N2<span class="special">&gt;</span> 
  <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a5c6da91d00da9e62c5afe649baa15fff"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager2</span><span class="special">,</span> <span class="identifier">N2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p>Not assignable from related <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a14fa523b81300aa4c3404e72b28bbd45"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span></pre>
<p>Not assignable from other <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.16.19.3.8.4.4.4"></a><h3>
<a name="id19-bb"></a><code class="computeroutput">private_node_allocator</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a9f7d0023a9166cd756009a2ad9b363ff"></a><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="identifier">segment_manager</span> <span class="special">*</span> segment_mngr<span class="special">)</span><span class="special">;</span></pre>
<p>Constructor from a segment manager. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a7b5e79a910935910e810c36323bb483d"></a><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor from other <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a>. Increments the reference count of the associated node pool. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T2<span class="special">&gt;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a05ff6fabe2e80dfc2bc229c00ba7d238"></a><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a><span class="special">&lt;</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">SegmentManager</span><span class="special">,</span> <span class="identifier">NodesPerBlock</span> <span class="special">&gt;</span> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<p>Copy constructor from related <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html" title="Class template private_node_allocator">private_node_allocator</a>. If not present, constructs a node pool. Increments the reference count of the associated node pool. Can throw <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a909a7db34a2a73072187f80e460613ce"></a><span class="special">~</span><span class="identifier">private_node_allocator</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destructor, removes node_pool_t from memory if its reference count reaches to zero. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">node_pool_t</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a923c2c1779b1ec0998bfecce6dad8d40"></a><span class="identifier">get_node_pool</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns a pointer to the node pool. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">segment_manager</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a3e9b4035058a6e60661f8cfcd0e4b892"></a><span class="identifier">get_segment_manager</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the segment manager. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a0bc39a3729b7120c51331e3fd6e26485"></a><span class="identifier">max_size</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns the number of elements that could be allocated. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a1c21c614c3522dc0c9b17474a3a238d4"></a><span class="identifier">allocate</span><span class="special">(</span><span class="identifier">size_type</span> count<span class="special">,</span> <span class="identifier">cvoid_pointer</span> hint <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocate memory for an array of count elements. Throws <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a2d8f5cf1e99e358428ba89f15a87b3fa"></a><span class="identifier">deallocate</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">size_type</span> count<span class="special">)</span><span class="special">;</span></pre>
<p>Deallocate allocated memory. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1aad62c959525fa1c8d523711342211d2a"></a><span class="identifier">deallocate_free_blocks</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Deallocates all free blocks of the pool </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ad1ae73cfdc1eb6a9442c703fe7f9eea8"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns address of mutable object. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">const_pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a9565fcbc2b56d44aa1d64f935fd4af04"></a><span class="identifier">address</span><span class="special">(</span><span class="identifier">const_reference</span> value<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns address of non mutable object. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a3069e9cc315813531e4163a564b1181c"></a><span class="identifier">construct</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">,</span> <span class="identifier">const_reference</span> v<span class="special">)</span><span class="special">;</span></pre>
<p>Copy construct an object. Throws if T's copy constructor throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a380dd74ad20a84e4694c69ca7dedbead"></a><span class="identifier">destroy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> ptr<span class="special">)</span><span class="special">;</span></pre>
<p>Destroys object. Throws if object's destructor throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">size_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a50c969eba82fc4b35ecbee43d3809e63"></a><span class="identifier">size</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns maximum the number of objects the previously allocated memory pointed by p can hold. This size only works for memory allocated with allocate, allocation_command and allocate_many. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1adc2307da55baac1e02fcb975d8af147b"></a><span class="identifier">allocation_command</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">interprocess</span><span class="special">::</span><span class="identifier">allocation_type</span> command<span class="special">,</span> 
                           <span class="identifier">size_type</span> limit_size<span class="special">,</span> 
                           <span class="identifier">size_type</span> <span class="special">&amp;</span> prefer_in_recvd_out_size<span class="special">,</span> 
                           <span class="identifier">pointer</span> <span class="special">&amp;</span> reuse<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a83bb002d201537ba2792cab8785f36e6"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="identifier">size_type</span> elem_size<span class="special">,</span> <span class="identifier">size_type</span> num_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a89fbbfee49116bb42845465e86f06987"></a><span class="identifier">allocate_many</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">size_type</span> <span class="special">*</span> elem_sizes<span class="special">,</span> <span class="identifier">size_type</span> n_elements<span class="special">,</span> 
                   <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates n_elements elements, each one of size elem_sizes[i]in a contiguous block of memory. The elements must be deallocated </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a66d21182bf1f50c75b300d2809a6ba90"></a><span class="identifier">deallocate_many</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size elem_size in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. The elements must be deallocated with deallocate(...) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">pointer</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ac15da8a1118ed1859b51101d0a6e05d7"></a><span class="identifier">allocate_one</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Allocates just one object. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a6ec722b4bc59327bed01cfc0261ff3ca">deallocate_one()</a>. Throws <a class="link" href="classboost_1_1interprocess_1_1bad__alloc.html" title="Class bad_alloc">boost::interprocess::bad_alloc</a> if there is no enough memory </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a843dfee9a7c61750596cf5086113ddde"></a><span class="identifier">allocate_individual</span><span class="special">(</span><span class="identifier">size_type</span> num_elements<span class="special">,</span> 
                         <span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a6ec722b4bc59327bed01cfc0261ff3ca">deallocate_one()</a>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a6ec722b4bc59327bed01cfc0261ff3ca"></a><span class="identifier">deallocate_one</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">pointer</span> <span class="special">&amp;</span> p<span class="special">)</span><span class="special">;</span></pre>
<p>Deallocates memory previously allocated with <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ac15da8a1118ed1859b51101d0a6e05d7">allocate_one()</a>. You should never use deallocate_one to deallocate memory allocated with other functions different from <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1ac15da8a1118ed1859b51101d0a6e05d7">allocate_one()</a>. Never throws </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a594ea1f4c7a868a0c054d76bbbd7b0ad"></a><span class="identifier">deallocate_individual</span><span class="special">(</span><span class="identifier">multiallocation_chain</span> <span class="special">&amp;</span> chain<span class="special">)</span><span class="special">;</span></pre>
<p>Allocates many elements of size == 1 in a contiguous block of memory. The minimum number to be allocated is min_elements, the preferred and maximum number is preferred_elements. The number of actually allocated elements is will be assigned to received_size. Memory allocated with this function must be deallocated only with <a class="link" href="classboost_1_1interprocess_1_1private__node__allocator.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a6ec722b4bc59327bed01cfc0261ff3ca">deallocate_one()</a>. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.16.19.3.8.4.4.5"></a><h3>
<a name="id20-bb"></a><code class="computeroutput">private_node_allocator</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1private__node__allocator_1a63777ee47c37b3f6817aa6fc57db0e0d"></a><span class="identifier">swap</span><span class="special">(</span><span class="identifier">self_t</span> <span class="special">&amp;</span> alloc1<span class="special">,</span> <span class="identifier">self_t</span> <span class="special">&amp;</span> alloc2<span class="special">)</span><span class="special">;</span></pre>
<p>Swaps allocators. Does not throw. If each allocator is placed in a different memory segment, the result is undefined. </p>
</li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005-2024 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="private__adaptive__pool_8hpp_1a74111b10a62b43195fd1de4fd96bfadd.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.private__node__allocator_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1interprocess_1_1private__node__allocator_1_1rebind.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
